package com.sola.oauthserver.security;

import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * 在spring boot 2.0以后 内存方式声明用户和密码时，需要这个类
 */

public class MyPasswordEncoder implements PasswordEncoder {

    //直接返回明文密码
    @Override
    public String encode(CharSequence charSequence) {
        return charSequence.toString();
    }

    //以明文密码进行验证
    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return s.equals(charSequence.toString());
    }
}
